package com.jinbo.footmessageworker.httpretrofit;


import com.jinbo.footmessageworker.httpbean.BaseBean;
import com.jinbo.footmessageworker.httpbean.LookSignBean;
import com.jinbo.footmessageworker.httpbean.OrdersBean;
import com.jinbo.footmessageworker.httpbean.SignBean;
import com.jinbo.footmessageworker.httpbean.TurnsBean;
import com.jinbo.footmessageworker.httpbean.WorkerInformationBean;

import retrofit.Callback;
import retrofit.mime.TypedFile;

public class HttpBusinessStore {


    /**
     * 登录
     *
     * @param name
     * @param passWord
     * @param callback
     */
    public void login(String name, String passWord, Callback<BaseBean<WorkerInformationBean>> callback) {
        HttpProtocolFactory.getProtocol(HttpProtocolFactory.HOST_URL_USER,
                HttpProtocol.class).login(name, passWord, callback);
    }

    /**
     * 修改密码
     *
     * @param user_id
     * @param old_password
     * @param new_password
     * @param callback
     */
    public void modifyUserPassword(String user_id, String old_password, String new_password, Callback<BaseBean<WorkerInformationBean>> callback) {
        HttpProtocolFactory.getProtocol(HttpProtocolFactory.HOST_URL_USER,
                HttpProtocol.class).modifyUserPassword(user_id, old_password, new_password, callback);
    }


    /**
     * 修改头像
     *
     * @param user_id
     * @param file
     * @param kind
     * @param callback
     */
    public void modifyFace(String user_id, TypedFile file, int kind, Callback<BaseBean<WorkerInformationBean>> callback) {
        HttpProtocolFactory.getProtocol(HttpProtocolFactory.HOST_URL_USER,
                HttpProtocol.class).modifyFace(user_id, file, kind, callback);
    }


    /**
     * 修改用户信息
     *
     * @param user_id
     * @param user_information
     * @param user_kind
     * @param callback
     */

    public void modifyInformation(String user_id, String user_information, int user_kind, Callback<BaseBean<WorkerInformationBean>> callback) {
        HttpProtocolFactory.getProtocol(HttpProtocolFactory.HOST_URL_USER,
                HttpProtocol.class).modifyUserInformation(user_id, user_information, user_kind, callback);
    }

    /**
     * 修改项目
     *
     * @param user_id
     * @param project_ids
     * @param callback
     */
    public void modifyProjects(String user_id, String project_ids, Callback<BaseBean<WorkerInformationBean>> callback) {
        HttpProtocolFactory.getProtocol(HttpProtocolFactory.HOST_URL_USER,
                HttpProtocol.class).modifyProjects(user_id, project_ids, callback);
    }

    /**
     * 获取项目表
     */
    public void getProjects(Callback<BaseBean<WorkerInformationBean>> callback) {
        HttpProtocolFactory.getProtocol(HttpProtocolFactory.HOST_URL_USER,
                HttpProtocol.class).getProjects(callback);
    }

    /**
     * 获取我的项目
     *
     * @param user_id
     */
    public void getMyProjects(String user_id, Callback<BaseBean<WorkerInformationBean>> callback) {
        HttpProtocolFactory.getProtocol(HttpProtocolFactory.HOST_URL_USER,
                HttpProtocol.class).getMyProjects(user_id, callback);
    }

    /**
     * 技师查询待确认订单
     *
     * @param worker_id
     */
    public void notConfirmOrder(String worker_id, Callback<BaseBean<OrdersBean>> callback) {
        HttpProtocolFactory.getProtocol(HttpProtocolFactory.HOST_URL_USER,
                HttpProtocol.class).notConfirmOrder(worker_id, callback);
    }

    /**
     * 技师接收待确认的单
     *
     * @param id
     */

    public void sureOrder(int id, String do_time, Callback<BaseBean<OrdersBean>> callback) {
        HttpProtocolFactory.getProtocol(HttpProtocolFactory.HOST_URL_USER,
                HttpProtocol.class).sureOrder(id, do_time, callback);
    }

    /**
     * 技师拒绝待确认的单
     *
     * @param id
     */
    public void rejectOrder(int id, String do_time, String reason, Callback<BaseBean<OrdersBean>> callback) {
        HttpProtocolFactory.getProtocol(HttpProtocolFactory.HOST_URL_USER,
                HttpProtocol.class).rejectOrder(id, do_time, reason, callback);
    }

    /**
     * 技师查询已接订单
     *
     * @param worker_id
     */
    public void dealtOrder(String worker_id, Callback<BaseBean<OrdersBean>> callback) {
        HttpProtocolFactory.getProtocol(HttpProtocolFactory.HOST_URL_USER,
                HttpProtocol.class).dealtOrder(worker_id, callback);
    }

    /**
     * 技师完成接收的单
     *
     * @param id
     */
    public void completeOrder(int id, String do_time, Callback<BaseBean<OrdersBean>> callback) {
        HttpProtocolFactory.getProtocol(HttpProtocolFactory.HOST_URL_USER,
                HttpProtocol.class).completeOrder(id, do_time, callback);
    }

    /**
     * 技师撤销已接的单
     *
     * @param id
     */
    public void cancelOrder(int id, String do_time, String reason, Callback<BaseBean<OrdersBean>> callback) {
        HttpProtocolFactory.getProtocol(HttpProtocolFactory.HOST_URL_USER,
                HttpProtocol.class).cancelOrder(id, do_time, reason, callback);
    }

    /**
     * 查询历史订单
     *
     * @param worker_id
     */
    public void historyOrder(String worker_id, int start, int limit, Callback<BaseBean<OrdersBean>> callback) {
        HttpProtocolFactory.getProtocol(HttpProtocolFactory.HOST_URL_USER,
                HttpProtocol.class).historyOrder(worker_id, start, limit, callback);
    }


    /**
     * 查询班次
     *
     * @param worker_id
     */
    public void turn(String worker_id, int start, int limit, Callback<BaseBean<TurnsBean>> callback) {
        HttpProtocolFactory.getProtocol(HttpProtocolFactory.HOST_URL_USER,
                HttpProtocol.class).turn(worker_id, start, limit, callback);
    }

    /**
     * 技师上下班签到
     * <p/>
     * <p/>
     * worker_id:string 技师ID
     * longitude:number 经度
     * latitude:number 纬度
     * time:string 签到时间（格式：格式2016-03-07 16:22:00）
     * date:string 今天日期（格式：格式2016-03-07 ）
     * kind:int
     */
    public void sign(String worker_id, double longitude, double latitude,
                     String time,
                     String date,
                     int kind,
                     Callback<BaseBean<SignBean>> callback) {
        HttpProtocolFactory.getProtocol(HttpProtocolFactory.HOST_URL_USER,
                HttpProtocol.class).sign(worker_id, longitude, latitude,
                time,
                date,
                kind, callback);
    }


    /**
     * 技师查询上下班签到
     * <p/>
     * <p/>
     * worker_id:string 技师ID
     */
    public void lookSign(String worker_id,
                     String date,
                     Callback<BaseBean<LookSignBean>> callback) {
        HttpProtocolFactory.getProtocol(HttpProtocolFactory.HOST_URL_USER,
                HttpProtocol.class).lookSign(worker_id,
                date,
                callback);
    }
}

